Unity: Order of execution
#Unity
#LifeCycle
unity oreder executionで検索
Unity - Manual: Order of Execution for Event Functions
Camera Update
カメラは基本的にLateUpdateで行ったほうがいい
Update: 普通のゲームロジック。dtで補完秒を取得
FixedUpdate: Updateと違い、固定時間で呼び出される。信頼できるタイマーを仕様
LateUpdate: Updateのあとに呼ばれる
キャラクタの移動とカメラの移動を同時に行うと、gitter(ちらつき)が発生する。
キャラ移動 -> カメラ移動と、順番が保証されている方がスムーズに描写できる。
code: .fs
type FollowCamera() =
inherit MonoBehaviour()
<DefaultValue>
val mutable public target: Transform
member this.LateUpdate() = this.transform.position <- this.target.position